﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>购物车</title>

    <link type="text/css" rel="stylesheet" href="/css/lookOrder.css"/>
</head>
<body>
<div class="CartTop">
    <div class="clearfix">
        <!--<img  class="shoppingCart left" src="/images/shoppingCart.png" alt="图片无法展示" width="45" height="45">-->
        <!--<span class="left mycart">您的购物车</span>-->

        <!--<div class="step-container">-->
            <!--<div class="step step1">核对订单</div>-->
            <!--<div class="step2">去支付</div>-->
            <!--<div class="step2">支付成功</div>-->
        <!--</div>-->
    </div>
    <div class="StockHead">
        <span>查询订单</span>
    </div>
    <div class="top">
        <form id="chooseFormLook" method="post">
            <!--cellpadding表示每个单元格之间的内间距为0，-->
            <table class="providerTable" cellpadding="0" cellspacing="0">
                <tr class="firstTr">
                    <th width="5%">请选择<span></span></th>
                    <th width="5%">编号<span></span></th>
                    <th width="10%">订单号<span></span></th>
                    <th width="22%">订货日期<span></span></th>
                    <th width="8%">订单状态<span></span></th>
                    <th width="10%">总金额</th>
                    <th width="10%">删除</th>
                    <th width="10%">查看</th>
                </tr>

                <tr th:each="t,line : ${placeOrderPage.items}">
                    <th><input type="checkbox"  class="checkbox"></th>
                    <th><span th:text="${line.count}"></span></th>
                    <th><span class="yy" th:text="${t.orderId}"th:value="${t.orderId}"></span></th>
                    <th><span th:text="${t.orderDate}" ></span></th>
                    <th><span th:text="${t.commodityStaus == 1 ? '未支付' : '已支付' }"></span></th>
                    <th><span th:text="${t.totalPrice}"></span></th>
                    <th  th:id="${t.orderId}">
                    <a class="button-delete"><img src="/images/delete.png" width="20" height="20" alt="加载失败"></a>
                </th>
                    <th>
                        <a class="button-look"><img src="/images/look.png" width="20" height="20" alt="加载失败"></a>
                    </th>
            </table>
            <form>
                <!--<div class="under">-->
                    <!--<div>-->
                        <!--<div class="left">-->
                            <!--<label><input type="checkbox" id="selectAll" />全选</label>-->
                        <!--</div>-->
                        <!--&lt;!&ndash;&lt;!&ndash;.clearfix:,清理浮动&ndash;&gt;&ndash;&gt;-->
                        <!--&lt;!&ndash;<p class="clearfix">&ndash;&gt;-->
                            <!--&lt;!&ndash;<span>&nbsp;&nbsp;元</span>&ndash;&gt;-->
                            <!--&lt;!&ndash;<span  class="left" id="totalPrices"></span>&ndash;&gt;-->
                            <!--&lt;!&ndash;<span class="left">商品总金额:</span>&ndash;&gt;-->
                        <!--&lt;!&ndash;</p>&ndash;&gt;-->
                    <!--</div>-->
    </div>
</div>
<!--<div class="button-bar clearfix">-->
    <!--<a class="button-btn" id="button-btn" name="add">结算</a>-->
<!--</div>-->
</body>
<script src="/js/jquery-2.2.1.min.js"></script>
<script src="/js/jump.js"></script>
<script type="text/javascript" th:inline="javascript">

    var gg=[];
    var orderId1=[];
    // var orderId = [];
    $(".button-btn").bind("click",function () {
        // alert("in")
        var $checkbox = $(".checkbox:checked");
        if($checkbox.length==0){
            alert("您没有选择东西")
        }else{
            $checkbox.each(function (i) {
                gg[i] = $(this).val();
                var tr = $(this).parent().parent();
               var orderId =  tr[0].getElementsByClassName("yy");
               alert("order" + orderId)
                orderId1[i]  = orderId[0].innerHTML;
               alert(orderId)
            })
        }
        // toJump("/lookCommodity/placePay","orderId="+orderId1);
        location="/lookCommodity/placePay?orderId="+orderId1;

    });


    //删除按钮按钮绑定事件
    $(".button-delete").bind("click",function () {
        alert("你好呀")
        var orderId = $(this).parent().attr("id");
        alert(orderId);
        // toJump("/lookCommodity/remove","orderId="+orderId);
        location="/lookCommodity/remove?orderId="+orderId;
    });

    //查看按钮绑定事件
    $(".button-look").bind("click",function () {
        alert("我不好")
        var orderId = $(this).parent().prev().attr("id");
        // toJump("/lookCommodity/chakan","orderId="+orderId);
        location="/lookCommodity/chakan?orderId="+orderId;

    });


</script>
</html>